<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8" />	
	<title><?=$this->admin->config['sitename']?> Administration Login</title>	
	<script type="text/javascript" src="<?=url_tmpl()?>js/jquery.js"></script>
	 <link  media="screen" rel="stylesheet" type="text/css" href="<?=url_tmpl()?>login.css" />

<!-- icemanvn -->
<style type="text/css">


#container {
	width:400px;
	padding:0px;
	background:#fefefe;
	margin:0 auto;
	border:1px solid #c4cddb;
	border-top-color:#d3dbde;
	border-bottom-color:#bfc9dc;
	box-shadow:0 1px 1px #ccc;
	border-radius:5px;
	position:relative;
}

form ul li {
	margin:10px 20px;

}


#container span {
	background:#f6f6f6;
	padding:3px 5px;
	display:block;
	border-radius:5px;
	margin-top:5px;
}

#pswd_info {
//	position:absolute;
	bottom:150px;
	bottom: -115px\9; /* IE Specific */
	left:20px;
	width:250px;
	padding:15px;
	background:#fefefe;
	font-size:.875em;
	border-radius:5px;
	box-shadow:0 1px 3px #ccc;
	border:1px solid #ddd;
}

#pswd_info h4 {
	margin:0 0 10px 0;
	padding:0;
	font-weight:normal;
}

#pswd_info::before {
	content: "\25B2";
	position:absolute;
	top:-12px;
	left:45%;
	font-size:14px;
	line-height:14px;
	color:#ddd;
	text-shadow:none;
	display:block;
}
.invalid {
	background:url(../images/invalid.png) no-repeat 0 50%;
	padding-left:22px;
	line-height:24px;
	color:#ec3f41;
}
.valid {
	background:url(../images/valid.png) no-repeat 0 50%;
	padding-left:22px;
	line-height:24px;
	color:#3a7d34;
}

</style>	 
<!-- end icemanvn -->	 
       <script>
	    jQuery.extend({
	random: function(X) {
	    return Math.floor(X * (Math.random() % 1));
	},
	randomBetween: function(MinV, MaxV) {
	  return MinV + jQuery.random(MaxV - MinV + 1);
	}
});
  $(document).ready(function(){
		//iceman
	
		
		$('input[type=password]').keyup(function() {
			var pswd = $(this).val();
			if ( pswd.length < 8 ) {
				$('#length').removeClass('valid').addClass('invalid');
			} else {
				$('#length').removeClass('invalid').addClass('valid');
				
			}
			//validate letter
			if ( pswd.match(/[A-z]/) ) {
				$('#letter').removeClass('invalid').addClass('valid');
			} else {
				$('#letter').removeClass('valid').addClass('invalid');
				
			}

			//validate spacial letter
		//	if ( pswd.match(/[A-Z]/) ) {
			if ( pswd.match(/\W/) ) {
				$('#capital').removeClass('invalid').addClass('valid');
			} else {
				$('#capital').removeClass('valid').addClass('invalid');
				
			}

			//validate number
			if ( pswd.match(/\d/) ) {
				$('#number').removeClass('invalid').addClass('valid');
			} else {
				$('#number').removeClass('valid').addClass('invalid');
				
			}

		});
		$('input[type=password]').focus(function() {
			$('#pswd_info').show();
		});
		$('input[type=password]').blur(function() {
			$('#pswd_info').hide();
		});
		
		function show_err(msg)
		{
			$("#ajax_loading").hide();
			$("#submit").show();
			$("#error_notification").show();
			$("#error_notification").html(msg);
		}
		
		$('#frmForm').submit(function() {
			if (($('#letter').attr('class') == 'valid') && ($('#capital').attr('class') == 'valid') && ($('#number').attr('class') == 'valid') && ($('#length').attr('class') == 'valid')  ) {
			//	alert("true");
				return true;
			}
			else {		
				alert("Đồng chí phải nhập Mật khẩu phải đúng theo các yêu cầu bảng bên trái! ");			
				return false; //Stop the form from submitting
			}
		});

		
				
		$("#icaptcha").click(function(){
            $id = $.randomBetween(100, 1000);
            $(this).attr("src","<?=admin_url()?>authorize/captcha/"+$id+".do");
        });

		$("#reload").click(function(){
            $id = $.randomBetween(100, 1000);
            $("#icaptcha").attr("src","<?=admin_url()?>authorize/captcha/"+$id+".do");
        });
		
		
	});
	</script>
</head>

<body>
<center>
<div id="box" style="width:400px;">
	<h1>
		<?=$this->admin->config['sitename']?> Administration
	</h1>
	<p style="color:#F00;font-size: 250%;">
		Chú ý: <?=lang('changpass2')?>
	</p>
    <?php $error = $this->admin->GetFlashData('loginerror');
if(strlen($error)>0){
?>
<div id="error_notification"><?=$error?></div>
<?php }?>
   
	<center>
	<form  id="frmForm" action="<?=admin_url()?>authorize/savepass<?=url_suffix()?>" method="post" style="width:260px; text-align:left;">

		<p>
		<label for="password"><?=lang('password')?></label><br />
		<input type="password" tabindex="2" name="user_session[password]" id="password" class="input" >
		</p>
        <p>
		<label for="password"><?=lang('conf-pass')?></label><br />
		<input type="password" tabindex="2" name="user_session[password2]" id="password2" class="input" >
		</p>
		<!-- icemanvn -->
<p>


		<div id="pswd_info">
			<h4> Mật khẩu phải đúng theo các yêu cầu sau :</h4>
			<ul>
				<li id="letter" class="invalid">có ít nhất <strong> 1 (một) chữ</strong></li>
				<li id="capital" class="invalid">có ít nhất <strong>1 (một) ký tự đặc biệt</strong></li>
				<li id="number" class="invalid">có ít nhất <strong>1 (một) số</strong></li>
				<li id="length" class="invalid">độ dài tối thiểu của mật khẩu là <strong> 8(tám) </strong></li>
			</ul>
		</div>
</p>

		<!-- end icemanvn -->

        <p>
		<label for="captcha"><?=lang('captcha')?></label><br />
		
		<img  title="Click chuột để tạo mã xác nhận khác"  src="<?=admin_url()?>authorize/captcha/2904<?=url_suffix()?>" id="icaptcha">
		    <img id="reload" title="Click chuột để tạo mã xác nhận khác" style="cursor:pointer; margin-left:10px; margin-top:-25px;" align="absmiddle" src="<?=url_tmpl();?>images/reload.png" />
		    <input type="text" tabindex="3" name="user_session[captcha]" id="captcha" class="input captcha" >
        <div style="clear:both"></div>
		</p>

		
		<input class="button" id="submit" type="submit" tabindex="4" name="submit" value="<?=lang('save')?>" >
		<div class="clearfix"></div>
		
	</form>
	</center>
	<footer>
		<p class="author">
			©&nbsp;2011<?=(date("Y")>2011)?' - '.date("Y"):''?>&nbsp;<?=$this->admin->config['copyright']?>&nbsp;-&nbsp;Designed by Ban Ứng dụng CNTT
		</p>
	</footer>
    </div>
</center>
</body>

</html>